package ls.repository;

import ls.model.Moaning;
import ls.model.Reply;
import ls.model.Vote;

import java.util.List;

public interface MoaningRepository {

    long getMoaningCount();

    /**
     * Only adds the moaning (no referenced objects).
     * 
     * @param moaning
     * @return 
     */
    long saveMoaning(Moaning moaning);

    /**
     * Loads the moaning with all the referenced objects.
     * 
     * @param id
     * @return 
     */
    Moaning getMoaning(long id);

    Moaning getRandomMoaning();

    Moaning getRandomMoaning(int minReplies);

    /**
     * Loads the moaning with all the referenced objects.
     * 
     * @param id
     * @return 
     */
    List<Moaning> getMoanings();

    void addReply(Long moaningId, Reply reply);
    
    void addVote(Long moaningId, Vote vote);
    
    Reply getReply(long replyId);
}
